package com.cencat.merchant.entity;

import com.baomidou.mybatisplus.annotation.*;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * 司机商家绑定实体类
 * 
 * @author cencat
 * @since 2024
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("biz_driver_merchant_bind")
public class DriverMerchantBindEntity {
    
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 租户ID
     */
    @NotNull(message = "租户ID不能为空")
    @TableField("tenant_id")
    private Long tenantId;
    
    /**
     * 司机ID
     */
    @NotNull(message = "司机ID不能为空")
    @TableField("driver_id")
    private Long driverId;
    
    /**
     * 商家ID
     */
    @NotNull(message = "商家ID不能为空")
    @TableField("merchant_id")
    private Long merchantId;
    
    /**
     * 绑定类型(1-专属,2-推荐,3-普通)
     */
    @NotNull(message = "绑定类型不能为空")
    @Min(value = 1, message = "绑定类型值无效")
    @Max(value = 3, message = "绑定类型值无效")
    @TableField("bind_type")
    private Integer bindType;
    
    /**
     * 优先级(数字越小优先级越高)
     */
    @NotNull(message = "优先级不能为空")
    @Min(value = 0, message = "优先级不能为负数")
    @TableField("priority")
    private Integer priority;
    
    /**
     * 绑定开始日期
     */
    @NotNull(message = "绑定开始日期不能为空")
    @TableField("start_date")
    private LocalDate startDate;
    
    /**
     * 绑定结束日期
     */
    @TableField("end_date")
    private LocalDate endDate;
    
    /**
     * 绑定状态(0-无效,1-有效,2-暂停)
     */
    @NotNull(message = "绑定状态不能为空")
    @Min(value = 0, message = "绑定状态值无效")
    @Max(value = 2, message = "绑定状态值无效")
    @TableField("bind_status")
    private Integer bindStatus;
    
    /**
     * 服务费率(%)
     */
    @DecimalMin(value = "0.0", message = "服务费率不能为负数")
    @DecimalMax(value = "100.0", message = "服务费率不能超过100%")
    @TableField("service_rate")
    private java.math.BigDecimal serviceRate;
    
    /**
     * 月度订单限额
     */
    @Min(value = 0, message = "月度订单限额不能为负数")
    @TableField("monthly_order_limit")
    private Integer monthlyOrderLimit;
    
    /**
     * 已完成订单数
     */
    @Min(value = 0, message = "已完成订单数不能为负数")
    @TableField("completed_orders")
    private Integer completedOrders;
    
    /**
     * 绑定备注
     */
    @Size(max = 500, message = "绑定备注长度不能超过500个字符")
    @TableField("bind_remark")
    private String bindRemark;
    
    /**
     * 审核状态(0-待审核,1-审核通过,2-审核拒绝)
     */
    @NotNull(message = "审核状态不能为空")
    @Min(value = 0, message = "审核状态值无效")
    @Max(value = 2, message = "审核状态值无效")
    @TableField("audit_status")
    private Integer auditStatus;
    
    /**
     * 审核人ID
     */
    @TableField("audit_by")
    private Long auditBy;
    
    /**
     * 审核时间
     */
    @TableField("audit_time")
    private LocalDateTime auditTime;
    
    /**
     * 审核意见
     */
    @Size(max = 500, message = "审核意见长度不能超过500个字符")
    @TableField("audit_remark")
    private String auditRemark;
    
    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    
    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
    
    /**
     * 创建人
     */
    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;
    
    /**
     * 更新人
     */
    @TableField(value = "update_by", fill = FieldFill.INSERT_UPDATE)
    private Long updateBy;
    
    /**
     * 逻辑删除标识(0-未删除,1-已删除)
     */
    @TableLogic
    @TableField("deleted")
    private Integer deleted;
}